package com.erp.base.business.service;

import java.util.List;

import org.springframework.stereotype.Service;

import com.erp.base.base.CrudService;
import com.erp.base.business.dao.RegionDao;
import com.erp.base.business.entity.Area;
import com.erp.base.business.entity.Region;

@Service
public class RegionService extends CrudService<RegionDao, Region, Long> {

	public Region findCityByShortName(String shortName) {
		Region region=new Region();
		region.setShortName(shortName);
		//默认查询城市级别
		region.setLevelType(2);
		List<Region> regionList = dao.findList(region);
		if(regionList!=null&&!regionList.isEmpty()){
			return regionList.get(0);
		}
		return null;
	}
	public List<Area> getRegion(){
		return dao.getRegion();
	}
	public Area getRegionById(Long id){
		return dao.getRegionById(id);
	}
}
